<?php

class Form_Admin_Profile extends Form_Custom_General {

    public function init() {

        $lgn_name = $this->createElement('text', 'lgn_name')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array("class" => "span12", "placeholder" => "Name"));
        $this->addElement($lgn_name);

        $lgn_phone = $this->createElement('text', 'lgn_phone')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Phone should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array("class" => "span12", "placeholder" => "Phone"));
        $this->addElement($lgn_phone);

        $minPwdValidator = new Zend_Validate_StringLength(array('min' => 6));
        $minPwdValidator->setMessage('Password should be minimum of 6 characters.');
        $password = $this->createElement('password', 'password')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Password should not be blank.')))
                ->addValidator($minPwdValidator, true)
                ->setAttribs(Array("class" => "span12", "placeholder" => "Password"));
        $this->addElement($password);

        $confirmpassword = $this->createElement('password', 'user_confirmpassword')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Confirm password should not be blank.')))
                ->setAttribs(Array("class" => "span12", "placeholder" => "Confirm Password"));
        $this->addElement($confirmpassword);
    }

}